]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
bluetooth: Fix undefined variable issue
authorJasper St. Pierre <jstpierre@mecheye.net>
Sat, 12 Nov 2011 01:04:10 +0000 (20:04 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Sun, 13 Nov 2011 20:23:38 +0000 (15:23 -0500)
https://bugzilla.gnome.org/show_bug.cgi?id=663891

js/ui/status/bluetooth.js

index f2d95f504d8485c43fc3c8d2b794daf47f5e35e2..9118c6f605fbdfa8ea7191a2285dcb5f83786a66 100644 (file)
@@ -204,9 +204,10 @@ Indicator.prototype = {
 
     _buildDeviceSubMenu: function(item, device) {
         if (device.can_connect) {
+            let menuitem = new PopupMenu.PopupSwitchMenuItem(_("Connection"), device.connected);
             item._connected = device.connected;
-            item._connectedMenuitem = new PopupMenu.PopupSwitchMenuItem(_("Connection"), device.connected);
-            item._connectedMenuitem.connect('toggled', Lang.bind(this, function() {
+            item._connectedMenuItem = menuitem;
+            menuitem.connect('toggled', Lang.bind(this, function() {
                 if (item._connected > ConnectionState.CONNECTED) {
                     // operation already in progress, revert
                     // (should not happen anyway)
@@ -241,7 +242,7 @@ Indicator.prototype = {
                 }
             }));
 
-            item.menu.addMenuItem(item._connectedMenuitem);
+            item.menu.addMenuItem(menuitem);
         }
 
         if (device.capabilities & GnomeBluetoothApplet.Capabilities.OBEX_PUSH) {